// var i;
// var $item_PaiZi_UIBindings = require("./Item_PaiZi_UIBindings");
// var $resKeeper = require("./ResKeeper");
// var l = cc._decorator;
// var u = l.ccclass;
// var d = l.property;
// var p = l.inspector;
// var h = (function (e) {
//     function t() {
//         var t = (null !== e && e.apply(this, arguments)) || this;
//         t.auto_ui = null;
//         return t;
//     }
//     __extends(t, e);
//     t.prototype.StartSet = function (e, t) {
//         this.auto_ui.node_xiao.active = !0;
//         this.auto_ui.node_da.active = !1;
//         this.auto_ui.node_xiao.children.forEach(function (t, o) {
//             t.active = o == e;
//         });
//         if (1009 == t) {
//             this.node.setPosition(68, -68);
//         } else {
//             this.size || (this.size = cc.v2(this.node.parent.parent.width, this.node.parent.parent.height));
//             this.node.x = this.size.x / 2 - 25;
//             this.node.y = (this.size.y / 2) * -1 + 25;
//         }
//     };
//     __decorate([d($item_PaiZi_UIBindings.default)], t.prototype, "auto_ui", void 0);
//     return __decorate([u], t);
// })($resKeeper.default);
// exports.default = h;


import ItemPaiZiUIBindings from "./Item_PaiZi_UIBindings";
import ResKeeper from "./ResKeeper";

const { ccclass, property } = cc._decorator;

/**
 * 建议类名：SignItemHandler
 */
@ccclass
export default class ItemPaiZi extends ResKeeper {
    @property(ItemPaiZiUIBindings)
    public auto_ui: ItemPaiZiUIBindings | null = null;

    private initialSize: cc.Vec2 | null = null;

    /**
     * 初始化设置
     * @param nodeIndex - 小节点的索引
     * @param nodeType - 类型标识
     * 建议方法名：initializeSettings
     */
    public initializeSettings(nodeIndex: number, nodeType: number): void {
        if (this.auto_ui) {
            this.auto_ui.node_xiao.active = true;
            this.auto_ui.node_da.active = false;
            this.auto_ui.node_xiao.children.forEach((childNode, childIndex) => {
                childNode.active = childIndex === nodeIndex;
            });
        }

        if (nodeType === 1009) {
            this.node.setPosition(68, -68);
        } else {
            if (!this.initialSize) {
                this.initialSize = cc.v2(this.node.parent.parent.width, this.node.parent.parent.height);
            }
            this.node.x = this.initialSize.x / 2 - 25;
            this.node.y = (this.initialSize.y / 2) * -1 + 25;
        }
    }
}